package st.mybatis01.controller;

import com.alibaba.fastjson.JSONObject;
import lombok.extern.log4j.Log4j;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import st.mybatis01.pojo.Article;
import st.mybatis01.service.ArticleService;

import javax.annotation.Resource;

/**
 * Created by sagagyq on 2017/4/1.
 */
@Log4j
@Controller
@RequestMapping("/")
public class FirstTestController {

    @Resource
    ArticleService articleService;

    @ResponseBody
    @RequestMapping("/tt")
    public String tt(){
        Article article = articleService.selectArticle(108);
        log.error(JSONObject.toJSONString(article));
        return JSONObject.toJSONString(article);
    }
}
